<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/page/common/public.jspf"%>
<%@ page import="com.hengpeng.itfints.tools.PageUtil" %>
<% 
	PageUtil pageUtil = (PageUtil)request.getAttribute("PageUtil");
%>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="${skin}/v1.min.css?v=${v}" />
<link rel="stylesheet" type="text/css" href="${skin}/index.css?v=${v}" />
<link href="${skin}/account_personalset.css?v=${v}" type="text/css"	rel="stylesheet">
<link rel="stylesheet" type="text/css" href="${skin}/user_web2.css?v=${v}" />
<link rel="stylesheet" type="text/css" href="${skin }/paginate.v1.css">

<script type="text/javascript" src="${path }/js/jquery1.10.2.min.js?v=${v}"></script>
<script type="text/javascript" src="${path }/js/v1.min.js?v=${v}"></script>
<title>${configUtil.sitename}-已投项目</title>
<style>
.yqjilu thead tr {
	border-bottom: 1px solid #e5e5e5;
}

.pagination { text-align: center; font-size: 14px;padding:25px 0px; border-top:1px solid #e0dede; }
.pagination ul { margin: 0; padding: 0; list-style: none;  }
.pagination ul li { margin: 0 3px; padding: 0; display: inline-block;  *zoom: 1;
 *display: inline;
vertical-align: top;text-align:center }
.pagination ul li.to { width: auto; }
.pagination ul li.pgcoder { width: auto; }
.pagination ul li.wrapinput { width: auto; }
.pagination ul li a { display: inline-block;  *zoom: 1;
 *display: inline;
width: 36px; height: 36px; line-height: 36px; text-decoration: none; color: #303030; font-family: arial; border: 1px solid #e7e7e7; }
.pagination ul li a:hover { color: white; background: #ffe7e3; border: 1px solid #fec8ba; color:#3d3d3d; }
.pagination ul li span { display: inline-block;  *zoom: 1;
 *display: inline;
width: 36px; height: 36px; line-height: 36px; color: #303030; }
.pagination ul li span.ellipse { font-family: 'simsun'; }
.pagination ul li span.current { display: inline-block; color: white; background: #ff9a87; border: 1px solid #fc633d; }
.pagination ul li span.prev,.pagination ul li span.next { width: 74px; background: #FFF;color:#cccccc;border:1px solid #e7e7e7;}
.pagination ul li a.prev { width: 74px; }
.pagination ul li a.prev:hover { }
.pagination ul li a.next { width: 74px; }
.pagination ul li a.next:hover { }
.pagination ul li.wrapinput { margin: 3px 0; padding: 0 23px 0 5px; width: 22px; background: url(../images/sf_paging.png) no-repeat -2px -98px; _background: url(../images/sf_paging.gif) no-repeat -2px -98px; }
.pagination ul li input.pageinput { padding: 6px 0; width: 22px; height: 12px; line-height: 12px; font-size: 12px; border: 0 none; outline: 0 none; background: none; }
.pagination ul li .graytext { color: #838383; width: auto; }
.pagination2 { text-align: right; height: 14px; }
.pagination2 ul { margin: 0; padding: 0; list-style: none; height: 14px; }
.pagination2 ul li { margin-left: 18px; padding: 0; display: inline-block;  *zoom: 1;
 *display: inline;
height: 14px; line-height: 14px; vertical-align: top; _vertical-align: baseline; }
.pagination2 ul li a { display: inline-block;  *zoom: 1;
 *display: inline;
height: 14px; line-height: 14px; text-decoration: none; color: #838383; font-family: arial; }
.pagination2 ul li a:hover { color: #303030; }
.pagination2 ul li span { display: inline-block;  *zoom: 1;
 *display: inline;
height: 14px; line-height: 14px; }
.pagination2 ul li span.ellipse { font-family: 'simsun'; }
.pagination2 ul li span.current { color: #303030; font-weight: bold; }
.pagination2 ul li span.prev { width: 8px; height: 14px; background: url(../images/sf_paging.png) no-repeat -69px -107px; _background: url(../images/sf_paging.gif) no-repeat -69px -106px; }
.pagination2 ul li span.next { width: 8px; height: 14px; background: url(../images/sf_paging.png) no-repeat -86px -107px; _background: url(../images/sf_paging.gif) no-repeat -86px -106px; }
.pagination2 ul li a.prev { width: 8px; height: 14px; background: url(../images/sf_paging.png) no-repeat -69px -88px; _background: url(../images/sf_paging.gif) no-repeat -69px -87px; }
.pagination2 ul li a.next { width: 8px; height: 14px; background: url(../images/sf_paging.png) no-repeat -86px -88px; _background: url(../images/sf_paging.gif) no-repeat -86px -87px; }


</style>
</head>

<body>
	<!-- head -->
	<c:import url="../../include/top.jsp"></c:import>

	<div class="wrap">
		<div class="blank"></div>
		<div class="user_nav f_l mr5">
			<c:import url="../left.jsp"></c:import>
		</div>
		<div class="user_right f_l">
			<div class="user_right">
				<c:choose>
					<c:when test="${fn:length(myInvestList) > 0}">
						<div class="user_right_box mb15 user_right_box_v2">
							<div class="user_title">
								<h1>
									<i class="ico_xiangmu"></i>已投项目
								</h1>
							</div>
							<input type="hidden" name="investInfoStatus" id="investInfoStatus" value="${investInfoStatus}"/>
							<form id="search" action='/account/load' method="get">
								<div class="screening clearfix">
									<div class="select_box" data-name="status">
										<div class="j_select"></div>
										<ul class="select_ul none j_selectContent">
											<li data-value="INVESTING">投标中</li>
											<li data-value="SUCESS">投标成功</li>
											<li data-value="LOANED">回款中</li>
											<li data-value="RETURNED">已回款</li>
										</ul>
									</div>
									<input type="hidden" name="type" value="" />
									<div class="sel_time">
										<span>时间</span> <input type="text" class="time_box"
											id="dateInput1" name="date_start" value=""><span
											class="pl10">-</span><input type="text" class="time_box"
											id="dateInput2" name="date_end" value="">
									</div>
									<input type="submit" value="筛选" class="button_shaixian fr">
								</div>
							</form>
							<table class="yqjilu" height="226">
								<colgroup>
									<col width="100">
									<col width="150">
									<col width="100">
									<col width="120">
									<col width="80">
								</colgroup>
								<thead>
									<tr>
										<th>时间</th>
										<td>类型</td>
										<td>解冻/冻结(元)</td>
										<td>资金变动(元)</td>
										<td>备注</td>
									</tr>
								</thead>
								<tbody>
								<c:forEach items="${myInvestList}" var="invest" begin="<%=pageUtil.getFromIndex()%>" end="<%=pageUtil.getToIndex() %>" varStatus="vstatus">
									<tr>
										<th>100万元</th>
										<td>0.1%</td>
										<td>12个月</td>
										<td>1000000*0.1%</td>
										<td>1000元</td>
									</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
					</c:when>
					<c:otherwise>
						<section>
							<div class="project clearfix u_zijin">
								<div class="pro_detailed clearfix">
									<div class="empty-box">没有记录</div>
								</div>
							</div>
						</section>
					</c:otherwise>
				</c:choose>
			</div>
<div id="pagination" class="pagination">
								<ul>
									<c:choose>
										<c:when test="${PageUtil.currentPage==1 }">
											<li><span name="pagebar_frist" class="current prev" title="首页">首页</span></li>
											<li><span name="pagebar_pre" class="current prev" title="上一页">上一页</span></li>
										</c:when>
										<c:otherwise>
											<li><a
												onclick="javascript:go(1);"
												href="javascript:void(0);" name="pagebar_frist"
												class="current prev" title="首页">首页</a></li>
											<li><a
												onclick="javascript:go(<%=(pageUtil.getCurrentPage() - 1)%>);"
												name="pagebar_pre" href="javascript:void(0);"
												class="current prev" title="上一页">上一页</a></li>
										</c:otherwise>
									</c:choose>
									<%
										if (pageUtil.getPageCount() <= 10) {
									%>
									<c:forEach var="index" begin="1"
										end="<%=pageUtil.getPageCount()%>">
										<c:choose>
											<c:when test="${PageUtil.currentPage ==index }">
												<li class="active"><span class="current">${index }</span></li>
											</c:when>
											<c:otherwise>
												<li><a
													onclick="javascript:go(${index });"
													href="javascript:void(0);" class="page-link">${index }</a></li>
											</c:otherwise>
										</c:choose>

									</c:forEach>
									<%
										} else if (pageUtil.getPageCount() > 10
												&& pageUtil.getCurrentPage() < 9) {
									%>
									<c:forEach var="index" begin="1" end="9">
										<c:choose>
											<c:when test="${PageUtil.currentPage ==index }">
												<li class="active"><span class="current">${index }</span></li>
											</c:when>
											<c:otherwise>
												<li><a
													onclick="javascript:go(${index });"
													href="javascript:void(0);" class="page-link">${index }</a></li>
											</c:otherwise>
										</c:choose>
									</c:forEach>
									<li class="disabled"><span class="ellipse">&hellip;</span></li>
									<li><a
											href="javascript:go(<%=pageUtil.getPageCount()%>);"
											class="page-link"><%=pageUtil.getPageCount()%></a></li>
									<%
										} else if (pageUtil.getPageCount() > 10
												&& pageUtil.getCurrentPage() >= 9
												&& (pageUtil.getPageCount() - pageUtil.getCurrentPage()) < 9) {
									%>
									<c:forEach var="index"
										begin="<%=pageUtil.getCurrentPage() - 1%>"
										end="<%=pageUtil.getPageCount()%>">
										<c:choose>
											<c:when test="${PageUtil.currentPage ==index }">
												<li class="active"><span class="current">${index }</span></li>
											</c:when>
											<c:otherwise>
												<li><a
													onclick="javascript:go(${index });"
													href="javascript:void(0);" class="page-link">${index }</a></li>
											</c:otherwise>
										</c:choose>
									</c:forEach>
									<%
										} else if (pageUtil.getPageCount() > 10
												&& pageUtil.getCurrentPage() >= 9
												&& (pageUtil.getPageCount() - pageUtil.getCurrentPage()) >= 9) {
									%>
									<c:forEach var="index" begin="<%=pageUtil.getCurrentPage() - 1%>"
										end="<%=pageUtil.getCurrentPage() + 7%>">
										<c:choose>
											<c:when test="${PageUtil.currentPage ==index }">
												<li class="active"><span class="current">${index }</span></li>
											</c:when>
											<c:otherwise>
												<li><a
													onclick="javascript:go(${index });"
													href="javascript:void(0);" class="page-link">${index }</a></li>
											</c:otherwise>
										</c:choose>
									</c:forEach>
									<li class="disabled"><span class="ellipse">&hellip;</span></li>
										<li><a
											href="javascript:go(<%=pageUtil.getPageCount()%>);"
											class="page-link"><%=pageUtil.getPageCount()%></a></li>
									<%
										}
									%>
									<%if(pageUtil.getCurrentPage()==pageUtil.getPageCount()) {%>
									<li><span name="pagebar_frist" class="current prev" title="下一页">下一页</span></li>
											<li><span name="pagebar_pre" class="current prev" title="尾页">尾页</span></li>
									<%}else{ %>
									<li><a
										onclick="javascript:go(<%=(pageUtil.getCurrentPage() + 1)%>);"
										href="javascript:void(0);" name="pagebar_next"
										class="page-link next" title="下一页">下一页</a></li>
									<li><a
										onclick="javascript:go(<%=pageUtil.getPageCount()%>);"
										href="javascript:void(0);" name="pagebar_last"
										class="page-link next" title="尾页">尾页</a></li>
										<%} %>
								</ul>
							</div>
			<script>
				function clickopen(id) {
					var url = '/account/contshow?tag=show&ajax=1&id=' + id;
					$.weeboxs.open(url, {
						boxid : null,
						contentType : 'iframe',
						showButton : true,
						showCancel : false,
						showOk : false,
						title : '合同详情',
						width : 750,
						height : 550,
						type : 'wee',
						onclose : function() {
							null
						}
					});
				}
				$(".j_shuhui")
						.click(
								function() {
									var id = $(this).attr('data-id');
									if (!id) {
										return false;
									}
									var url = '/account/loadshow?id=' + id;
									$.getJSON(url, function(data) {
										if (!data.status) {
											alert(data.info);
											return false;
										}
										$("#_js_name").html(data.info.name);
										$("#_js_money").html(data.info.money);
										$("#_js_sum").html(data.info.sum);
										$("#_js_title").html(data.info.title);
										if (data.info.is_holiday) {
											$("#_js_is_holiday").html(
													data.info.is_holiday);
										} else {
											$("#_js_is_holiday").hide();
										}
										$.weeboxs.open('.redemption', {
											contentType : 'selector',
											boxclass : "shuhui_box",
											onok : function() {
												redeem(id, this);
											},
											showButton : true,
											okBtnName : '确认赎回',
											showCancel : true,
											showOk : true,
											title : '赎回详情',
											height : 220,
											width : 450,
											type : 'wee',
											onclose : function() {
												null
											}
										});
									});

									function redeem(id, thiz) {
										var url = '/account/redeem';
										$(thiz).addClass('but-disabled').attr(
												"disabled", "disabled").css({
											"cursor" : "default"
										});
										$
												.post(
														url,
														{
															id : id
														},
														function(rs) {
															if (rs.status == 0) {
																alert('正在放款中，请稍后重试！');
																$(thiz)
																		.removeClass(
																				'but-disabled')
																		.removeAttr(
																				"disabled",
																				"disabled")
																		.css(
																				{
																					"cursor" : "pointer"
																				});
															} else {
																window.location.href = '/account/success/?id='
																		+ id
																		+ '&gS='
																		+ rs.jump.gS;
															}
														});
									}
								});
			</script>
		</div>

		<div class="blank"></div>
	</div>

	<c:import url="../../include/foot.jsp"></c:import>
	
	<script type="text/javascript">
	//分页
	function go (page) {
		window.location.href = "<%=request.getContextPath()%>/investInfo/myInvestList.htm?curPage="+page+"&investInfoStatus="+$("#investInfoStatus").val();
	}
	//状态查询
	function select (investInfoStatus) {
		window.location.href = "<%=request.getContextPath()%>/investInfo/myInvestList.htm?curPage=1&investInfoStatus="+investInfoStatus;
	}
	//查看收款计划
	function myreceiveplan (borrowInfoId, userId) {
		window.location.href = "<%=request.getContextPath()%>/repayment/myReceivePlanList.htm?borrowInfoId="+borrowInfoId+"&investUserId="+userId;
	}
</script> 
</body>
</html>